Telegram Group & Telegram Channel
🔐 AuthenticationProperties в ASP.NET Core — недооценённый, но важный механизм

Если вы используете куки или OpenID Connect в ASP.NET Core, то наверняка сталкивались с объектом AuthenticationProperties. Он не просто "дополнительные параметры" — это мощный инструмент управления поведением аутентификации.

💡 Что можно сделать с AuthenticationProperties:

Установить срок действия куки:

new AuthenticationProperties { ExpiresUtc = DateTimeOffset.UtcNow.AddHours(1) }


↩️ Указать URL возврата после логина:


new AuthenticationProperties { RedirectUri = "/dashboard" }


🧭 Добавить временные метки, элементы состояния, флаги:
Например, IsPersistent, IssuedUtc, AllowRefresh, и кастомные значения.

🧠 Используется в:

HttpContext.SignInAsync(...)

ChallengeAsync(...) для OIDC

редиректах после логина/логаута

🛠️ Это ключевой объект, если вы хотите более гибко управлять логикой входа, выхода и жизненным циклом сессии в ASP.NET Core.

📎 Полный разбор:
https://blog.duendesoftware.com/posts/20250527-the-role-of-authenticationproperties-in-aspnet-core

@csharp_ci



tg-me.com/csharp_ci/1391
Create:
Last Update:

🔐 AuthenticationProperties в ASP.NET Core — недооценённый, но важный механизм

Если вы используете куки или OpenID Connect в ASP.NET Core, то наверняка сталкивались с объектом AuthenticationProperties. Он не просто "дополнительные параметры" — это мощный инструмент управления поведением аутентификации.

💡 Что можно сделать с AuthenticationProperties:

Установить срок действия куки:


new AuthenticationProperties { ExpiresUtc = DateTimeOffset.UtcNow.AddHours(1) }


↩️ Указать URL возврата после логина:


new AuthenticationProperties { RedirectUri = "/dashboard" }


🧭 Добавить временные метки, элементы состояния, флаги:
Например, IsPersistent, IssuedUtc, AllowRefresh, и кастомные значения.

🧠 Используется в:

HttpContext.SignInAsync(...)

ChallengeAsync(...) для OIDC

редиректах после логина/логаута

🛠️ Это ключевой объект, если вы хотите более гибко управлять логикой входа, выхода и жизненным циклом сессии в ASP.NET Core.

📎 Полный разбор:
https://blog.duendesoftware.com/posts/20250527-the-role-of-authenticationproperties-in-aspnet-core

@csharp_ci

BY C# (C Sharp) programming




Share with your friend now:
tg-me.com/csharp_ci/1391

View MORE
Open in Telegram


C C Sharp programming Telegram | DID YOU KNOW?

Date: |

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

C C Sharp programming from kr


Telegram C# (C Sharp) programming
FROM USA